uboatfandomcom-20200214-history
Texture modding
Unity – Working with textures. This is my first guide so bear with me. I might have forgotten something to so feel free to edit or change anything that is not correct. Working with Unity and textures are not really that complex as soon as you understand the ground principles. When first coming in to Unity it sure looks alot but for texture modding you won't have to bother with 99% of it. Some of the major obstacIes i had during my learning process turned out to be a game bugs. With that said, nothing is easy when you don’t know how so here we go. With this guide I assume that you have set up Unity HUB and installed the correct version needed for projects with Uboat. I also recommend that you go through Nihilcats articles on modding first. Note! Remember to run “update game assemblies” under the “tools” tab and set up the path to uboat.exe before you continue. So, when working with textures there are three very important things you should ALWAYS remember and double check if something doesn’t work. These are the: 1. Manifest.asset file. 2. Meta files for each texture. 3. Texture path. During the guide you will learn why these are important. First off. Like the welcome window explains, when you start Unity for the first time you, have two main folders to manage when making a project, they are located in left window under the “Project” tab. Click on this to expand so you end up seeing two subfolders called “Mods” and “packages”. NOTE! The main folder on the bottom called “Packages”, outlined in black, should not be used or touched in this guide. Expand “Assets” and the paths in the left window should look like this. 1. Assets/Mods/modname 2. Assets/Packages/modname Now, folder 1 is where Unity will output your mod. All files in here is what will be bundled in your mod and copied to your mod folder and eventually to workshop. This is also the folder where you put your modded “data sheets”, “configs” or any other scripts as they don’t need processing and is supplied as is. Folder 2 is your work folder. Its here where you will add textures and new folders. The first thing we do is to add a new folder within the “modname” folder called “Textures”. Make sure you use Case sensitive names when creating folders. Im not sure if it’s needed but very often this is needed in coding. So now we have the basis for starting extracting textures with “Inspector” in-game. Some of you might have old mods ready to go as I did. But just adding the textures is not enough. What happens is that Unity generates “Meta” files with a GUID number which will not correspond with the original textures in the game. So your mod will not work as it doesn’t know which texture to override. GUID and folder path has to match what you see in “Inspector” under “Textures” in-game. Reason is that almost every texture is hooked to a specific GUID with a few exceptions where some are hooked up with the texture path. It works like a fingerprint. So what I did was to extract every texture I had again, straight into the project folder “Assets/Packages/modname/Textures, so Unity could generate meta files with the correct GUID then replace the textures. Remember, When extracting texture make new subfolders along the way as you progress. Ok ,so I assume you are with me at this point and have extracted all the textures you want in the correct folders/paths. Now you can either start modding the ones you have extracted or overwrite with textures you already have from older mods. Remember to make sure you have the texture names right and that they are in “PNG” format. When all textures are in place we need to ready the mod by doing a couple of things. 1. A problem I always get is that the “manifest.asset” file never update automatically so we are going to fix that now. The file is located in “Assets/Packages/Modname” folder. In the middle window you can click on the file to get its contents up in the inspector window. The file should contain all the textures with correct path. If its empty we need to create a new one. Right click the file and delete it. Then right click in the same window anywhere and click on “Create” then “Asset Bundle Descriptor”. This makes a new empty file. Now go to tools tab top of screen and run “Validate asset bundle manifests”. If you check the inspector window, you should now see a list with all your textures. 2. Make a screenshot of your mod and put it in this folder. Should look like this: “Mods/modname/Preview.png”. This is the mod thumbnail used by workshop. Now we are rdy to deploy the mod to your mod folder located in: “C:\Users\username\AppData\LocalLow\Deep Water Studio\UBOAT\Mods” You might have to turn on “Show hidden folders” in windows. Go to the “Tools” tab and run “Deploy Mods”. Takes a minute depending the mod size. When it’s done open uboatlauncher.exe and enable mod. Now you can run the game and test the game from the launcher or close launcher and test within the Unity editor by pressing the play button. Now after you have launched the mod to workshop you will be able to edit your mods “Manifest.json” file. Here you can edit version number, minimum build required, author and such. You can NOT edit this until you have uploaded it once because it doesn’t have the format until that’s done. After uploaded it should look like this. { "name": "Grey Wolves Texture Pack", "version": "1.0d", "description": "Adds historical flags, caps and uniforms.\r\n\r\nTextures by Vostok and Raggz.\r\nManaged and updates by Raggz.", "author": "Raggz", "minGameVersion": "B125", "maxGameVersion": "", "assemblyName": "", "permissions": [], "steamFileId": xxxxxxxxxxx } WARNING! Do not EVER delete the meta files for your textures. If you do you will have to extract them again. Make backups for safe keepings. Also make a backup of your project folder. I am pretty glad that I did :P Tips! You can only extract from the Texture folder in Inspector in-game. Trying to extract through meshes and such will not provide you the correct GUID in the metafiles. Meta files can be opened and edited with notepad. Faster and easier. Make folders using windows explorer. Faster. As soon as you click anywhere in Unity it will update folders and generate make meta files. If your mod don't work. Check that the GUID in the textures meta file corresponds with the in-game original texture. Use Inspector in-game to check. Also check that path is correct in your project.